﻿using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Remoter
{
    public class CommandArduino : CommandBase
    {
        public CommandArduino() { }
        public CommandArduino(SerialPort port, string cmdText)
            :base(port, cmdText)
        {

        }

        public override string Execute()
        {
            try
            {
                this.Port.Write(this.CommandText);
                return "success";
            }
            catch (FormatException)
            {
                return "failed";
            }
        }
    }
}
